import request from '@/router/axios';
import serviceList from '@/config/serviceList'
import {baseURL} from '@/api/common';

const {aihumanCore, kwRobot} = serviceList

export const getAimetaProjectList = (data) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/getPageList`,
    method: 'post',
    data
  })
}
export const deleteProject = (params) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/deleteProject`,
    method: 'post',
    params
  })
}
export const robotInstanceList = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/huilan-robot/listData`,
    method: 'post',
    data
  })
}
export const addOrUpdateProject = (data) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/addOrUpdateProject`,
    method: 'post',
    data
  })
}
export const copyProject = (data) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/copyProject`,
    method: 'post',
    data
  })
}
export const downloadConfigJSON = (params) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/downloadConfigJSON`,
    method: 'post',
    responseType: 'blob',
    params
  })
}
export const getDetail = (params) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/detail`,
    method: 'post',
    params
  })
}
export const updateProjectConfig = (data) => {
  return request({
    url: `${baseURL}api/${aihumanCore}/aimetaProjectManager/updateProjectConfig`,
    method: 'post',
    data
  })
}
